package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProjectFundingSourceMapper;
import com.ruoyi.system.domain.SysProjectFundingSource;
import com.ruoyi.system.service.ISysProjectFundingSourceService;

/**
 * 资金来源Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-03
 */
@Service
public class SysProjectFundingSourceServiceImpl implements ISysProjectFundingSourceService 
{
    @Autowired
    private SysProjectFundingSourceMapper sysProjectFundingSourceMapper;

    /**
     * 查询资金来源
     * 
     * @param id 资金来源主键
     * @return 资金来源
     */
    @Override
    public SysProjectFundingSource selectSysProjectFundingSourceById(Long id)
    {
        return sysProjectFundingSourceMapper.selectSysProjectFundingSourceById(id);
    }

    /**
     * 查询资金来源
     *
     * @param name 资金来源text
     * @return 资金来源
     */
    @Override
    public SysProjectFundingSource selectSysProjectFundingSourceByName(String name)
    {
        return sysProjectFundingSourceMapper.selectSysProjectFundingSourceByName(name);
    }

    /**
     * 查询资金来源列表
     * 
     * @param sysProjectFundingSource 资金来源
     * @return 资金来源
     */
    @Override
    public List<SysProjectFundingSource> selectSysProjectFundingSourceList(SysProjectFundingSource sysProjectFundingSource)
    {
        return sysProjectFundingSourceMapper.selectSysProjectFundingSourceList(sysProjectFundingSource);
    }

    /**
     * 新增资金来源
     * 
     * @param sysProjectFundingSource 资金来源
     * @return 结果
     */
    @Override
    public int insertSysProjectFundingSource(SysProjectFundingSource sysProjectFundingSource)
    {
        sysProjectFundingSource.setCreateTime(DateUtils.getNowDate());
        return sysProjectFundingSourceMapper.insertSysProjectFundingSource(sysProjectFundingSource);
    }

    /**
     * 修改资金来源
     * 
     * @param sysProjectFundingSource 资金来源
     * @return 结果
     */
    @Override
    public int updateSysProjectFundingSource(SysProjectFundingSource sysProjectFundingSource)
    {
        sysProjectFundingSource.setUpdateTime(DateUtils.getNowDate());
        return sysProjectFundingSourceMapper.updateSysProjectFundingSource(sysProjectFundingSource);
    }

    /**
     * 批量删除资金来源
     * 
     * @param ids 需要删除的资金来源主键
     * @return 结果
     */
    @Override
    public int deleteSysProjectFundingSourceByIds(Long[] ids)
    {
        return sysProjectFundingSourceMapper.deleteSysProjectFundingSourceByIds(ids);
    }

    /**
     * 删除资金来源信息
     * 
     * @param id 资金来源主键
     * @return 结果
     */
    @Override
    public int deleteSysProjectFundingSourceById(Long id)
    {
        return sysProjectFundingSourceMapper.deleteSysProjectFundingSourceById(id);
    }
}
